package com.wrk._1_语法._04_循环._01_单循环;

import java.util.Scanner;

public class _008_是否为回文数 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个整输");
        int perfectNumber = scanner.nextInt();
        int assist = perfectNumber;
        int reversal = 0;
        //将整输进行反转
        while (assist > 0){
            reversal = reversal*10+assist%10;
            assist = assist/10;
        }//反转后的整输和原数对比
        if (perfectNumber == reversal){
            System.out.println("整输"+perfectNumber+"是回文数");
        }else {
            System.out.println("整输"+perfectNumber+"不是回文数");
        }
    }
}
